Skip to content

Conversation

hpenne
Copy link

@hpenne hpenne commented Jun 15, 2025

  • Added a CHANGELOG.md entry

Summary

Replaced the dependency on rand_chacha with one on chacha20. Added some tests to std.rs to ensure that the output of StdRng did not change.

Fixes #934.

Motivation

Reduces total code size and the total amount of unsafe code.

Details

Changes to config.toml and some replacement of rand_chacha:: with chacha20::.

Added three new unit tests to std.rs. These were based on tests of IETF test vectors from rand_chacha, but the actual expected values had to be replaced, as the IETF test vectors are for ChaCha20 while rand uses ChaCha12. The expected values were generated by using rand_chacha (before chacha20 was used) to verify that the algorithm change did not affect the output.

@dhardy
Copy link
Member

dhardy commented Jun 17, 2025

I opened #1643. This PR is useful as a draft but won't be merged in its current form (likely we'll want the MSRV/edition bump first as its own PR).

I'm not certain on the timeline yet; the main blocker is the chacha20 release; we also need to decide whether we are ready to merge breaking changes to rand yet.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Replacing rand_chacha with chacha20
3 participants